package com.dw.dwdzcommerce.view.details;

import java.util.ArrayList;
import java.util.List;

import com.dw.dwdzcommerce.R;
import com.dw.dwdzcommerce.base.activity.BaseActivity;
import com.dw.dwdzcommerce.tools.uiView.smartMenu.SmartMenu;
import com.dw.dwdzcommerce.tools.uiView.smartMenu.SmartMenu.OnMenuClickListener;

public class MenuLayout {
	private SmartMenu mMenu;

	public void initModule(BaseActivity activity) {
		mMenu = (SmartMenu) activity.findViewById(R.id.activity_detail_menu_smartMenu);
		mMenu.setIsLimitTwo(true);
		mMenu.setIsRelevancy(false);
		List<String> optionOne = new ArrayList<String>(4);
		optionOne.add(activity.getString(R.string.details_menu_first_dest_close));
		optionOne.add(activity.getString(R.string.details_menu_first_cheapest));
		optionOne.add(activity.getString(R.string.details_menu_first_most_focus));
		optionOne.add(activity.getString(R.string.details_menu_first_shortest_time));

		List<String> optionTwo = new ArrayList<String>(4);
		optionTwo.add(activity.getString(R.string.details_menu_second_1));
		optionTwo.add(activity.getString(R.string.details_menu_second_2));
		optionTwo.add(activity.getString(R.string.details_menu_second_3));
		optionTwo.add(activity.getString(R.string.details_menu_second_4));
		
		mMenu.setFirstOption(optionOne);
		mMenu.setSecondOption(optionTwo);
		mMenu.setItemHeight(16);
	}
	/**
	 * 该方法会在创建完成后自动回调一次
	 * @param mListener
	 */
	public void setOnMenuClickListener(OnMenuClickListener mListener) {
		mMenu.setOnMenuClickListener(mListener);
	}
	

	public void end() {
		mMenu.show();
	}

}
